<?php
/**
 * Created by PhpStorm.
 * User: 快定
 * Date: 2022/2/24
 * Time: 21:48
 */

class Strategy
{
    public function how($obj)
    {
        $obj->way();
    }
}

class Bus
{
    public function way()
    {
        echo "bus";
    }
}

class Walk
{
    public function way()
    {
        echo "walk";
    }
}

$st1 = (new Strategy())->how(new Walk());
$st2 = (new Strategy())->how(new Bus());
